<?xml version="1.0" encoding="UTF-8"?>

<!-- 
FDT: device identification transformation for FF device identification xml files
-->
<xsl:transform 	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
		xmlns:str="http://xsltsl.org/string" 
		xmlns:ident="x-schema:DTMIdentSchema.xml"
		xmlns:fdt="x-schema:FDTDataTypesSchema.xml"
		xmlns:scanident="x-schema:DTMScanIdentSchema.xml"
		xmlns:devident="x-schema:DTMDeviceTypeIdentSchema.xml"
		xmlns:ffident="x-schema:FDTFieldbusIdentSchema.xml"
		xmlns:ffdevice="x-schema:FDTFieldbusDeviceTypeIdentSchema.xml"
		xmlns:ffscan="x-schema:FDTFieldbusScanIdentSchema.xml" version="2.0">
	<xsl:output method="xml" omit-xml-declaration="yes" indent="yes"/>
<!-- 
FDT: version of this file
-->

	<xsl:variable name="FileVersion">
		<xsl:number value="1.21"/>
	</xsl:variable>
	<xsl:output method="xml" omit-xml-declaration="yes" indent="yes"/>
<!-- 
root: transform device or scan identification
-->
	<xsl:template match="/">
			<xsl:apply-templates select="//ffscan:ScanIdentifications"/>
			<xsl:apply-templates select="//ffdevice:DeviceIdentifications"/>
	</xsl:template>
<!-- 
FF identification list <?xml version="1.0"?> 
-->
	<xsl:template match="ffdevice:DeviceIdentifications">
		<xsl:text disable-output-escaping="yes">&lt;?xml version="1.0"?&gt;
	&lt;!-- This file is created by FDTxxxIdentTransformation.xsl after transformation of xxxDTMDeviceIdentificationInstance.xml --&gt;
	&lt;FDT xmlns="x-schema:DTMDeviceTypeIdentSchema.xml" 
	 xmlns:ident="x-schema:DTMIdentSchema.xml" xmlns:fdt="x-schema:FDTDataTypesSchema.xml" &gt;</xsl:text>
				<xsl:element name="DeviceIdentifications">
					<xsl:apply-templates select="ffdevice:DeviceIdentification_FF_H1"/>
					<xsl:apply-templates select="ffdevice:DeviceIdentification_FF_HSE"/>
					<xsl:apply-templates select="ffdevice:DeviceIdentification_FF_Block"/>
				</xsl:element>
		<xsl:text disable-output-escaping="yes">&lt;/FDT&gt;</xsl:text>
	</xsl:template>
<!-- 
FF scan list
-->
	<xsl:template match="ffscan:ScanIdentifications">
			<xsl:text disable-output-escaping="yes">&lt;?xml version="1.0"?&gt;
	&lt;!-- This file is created by FDTxxxIdentTransformation.xsl after transformation of xxxDTMScanIdentificationInstance.xml --&gt;&lt;FDT xmlns="x-schema:DTMScanIdentSchema.xml" 
	 xmlns:ident="x-schema:DTMIdentSchema.xml" xmlns:fdt="x-schema:FDTDataTypesSchema.xml" &gt;</xsl:text>
				<xsl:element name="ScanIdentifications">
					<xsl:attribute name="fdt:busCategory">
						<xsl:value-of select="@fdt:busCategory"/>
					</xsl:attribute>
					<xsl:attribute name="resultState">
						<xsl:value-of select="@resultState"/>
					</xsl:attribute>
					<xsl:apply-templates select="ffscan:ScanIdentification_FF_H1"/>
					<xsl:apply-templates select="ffscan:ScanIdentification_FF_HSE"/>
					<xsl:apply-templates select="ffscan:ScanIdentification_FF_Block"/>
				</xsl:element>
		<xsl:text disable-output-escaping="yes">&lt;/FDT&gt;</xsl:text>
	</xsl:template>
<!-- 
FF H1 catalog identifcation
-->
	<xsl:template match="ffdevice:DeviceIdentification_FF_H1">
			<xsl:element name="DeviceIdentification">
				<xsl:attribute name="ident:idDTMSupportLevel">
					<xsl:value-of select="@ffident:idDTMSupportLevel"/>
				</xsl:attribute>
				<xsl:apply-templates select="ffdevice:IdBusProtocol"/>
				<xsl:element name="IdBusProtocolVersion" >
						<xsl:attribute name="ident:protocolSpecificName">not applicable</xsl:attribute>
				</xsl:element >
				<xsl:apply-templates select="ffdevice:IdManufacturer"/>
				<xsl:apply-templates select="ffdevice:IdTypeID"/>
				<xsl:apply-templates select="ffdevice:IdSoftwareRevision"/>
				<xsl:apply-templates select="ffdevice:IdHardwareRevision"/>
				<xsl:element name="IdValues">
					<xsl:apply-templates select="ffdevice:ManufacturerSpecificExtension"/>
				</xsl:element>
			</xsl:element>
	</xsl:template>
<!-- 
FF H1 scan identifcation
-->
	<xsl:template match="ffscan:ScanIdentification_FF_H1">
			<xsl:element name="ScanIdentification">
				<xsl:apply-templates select="@configuredState" />
				<xsl:apply-templates select="fdt:CommunicationError"/>
				<xsl:apply-templates select="ffscan:IdBusProtocol"/>
				<xsl:element name="IdBusProtocolVersion" >
						<xsl:attribute name="ident:protocolSpecificName">not applicable</xsl:attribute>
				</xsl:element >
				<xsl:apply-templates select="ffscan:IdAddress"/>			
				<xsl:apply-templates select="ffscan:IdManufacturer"/>
				<xsl:apply-templates select="ffscan:IdTypeID"/>
				<xsl:apply-templates select="ffscan:IdSoftwareRevision"/>
				<xsl:apply-templates select="ffscan:IdHardwareRevision"/>
				<xsl:apply-templates select="ffscan:IdTag"/>
				<xsl:apply-templates select="ffscan:IdSerialNumber"/>
				<xsl:element name="IdValues">
					<xsl:apply-templates select="ffscan:ManufacturerSpecificExtension"/>
				</xsl:element>
			</xsl:element>
	</xsl:template>
<!-- 
FF HSE catalog identifcation
-->
	<xsl:template match="ffdevice:DeviceIdentification_FF_HSE">
			<xsl:element name="DeviceIdentification">
				<xsl:attribute name="ident:idDTMSupportLevel">
					<xsl:value-of select="@ffident:idDTMSupportLevel"/>
				</xsl:attribute>
				<xsl:apply-templates select="ffdevice:IdBusProtocol"/>
				<xsl:element name="IdBusProtocolVersion" >
						<xsl:attribute name="ident:protocolSpecificName">not applicable</xsl:attribute>
				</xsl:element>
				<xsl:element name="IdManufacturer" >
						<xsl:attribute name="ident:protocolSpecificName">not applicable</xsl:attribute>
				</xsl:element>
				<xsl:apply-templates select="ffdevice:IdTypeID"/>	
				<xsl:element name="IdSoftwareRevision">
						<xsl:attribute name="ident:protocolSpecificName">not applicable</xsl:attribute>
				</xsl:element>
				<xsl:element name="IdHardwareRevision">
						<xsl:attribute name="ident:protocolSpecificName">not applicable</xsl:attribute>
				</xsl:element>
				<xsl:element name="IdValues">
					<xsl:apply-templates select="ffdevice:DeviceClass"/>
					<xsl:apply-templates select="ffdevice:VendorName"/>
					<xsl:apply-templates select="ffdevice:ModelName"/>
					<xsl:apply-templates select="ffdevice:Revision"/>
					<xsl:apply-templates select="ffdevice:ManufacturerSpecificExtension"/>
				</xsl:element>
			</xsl:element>
	</xsl:template>
<!-- 
FF HSE scan identifcation
-->
	<xsl:template match="ffscan:ScanIdentification_FF_HSE">
			<xsl:element name="ScanIdentification">
				<xsl:apply-templates select="@configuredState" />
				<xsl:apply-templates select="fdt:CommunicationError"/>
				<xsl:apply-templates select="ffscan:IdBusProtocol"/>
				<xsl:element name="IdBusProtocolVersion">
						<xsl:attribute name="ident:protocolSpecificName">not applicable</xsl:attribute>
				</xsl:element>
				<xsl:apply-templates select="ffscan:DataLinkAddress"/>	
				<xsl:element name="IdManufacturer">
						<xsl:attribute name="ident:protocolSpecificName">not applicable</xsl:attribute>
				</xsl:element>
				<xsl:apply-templates select="ffscan:IdTypeID"/>	
				<xsl:element name="IdSoftwareRevision">
						<xsl:attribute name="ident:protocolSpecificName">not applicable</xsl:attribute>
				</xsl:element>
				<xsl:element name="IdHardwareRevision">
						<xsl:attribute name="ident:protocolSpecificName">not applicable</xsl:attribute>
				</xsl:element>
				<xsl:apply-templates select="ffscan:IdTag"/>
				<xsl:element name="IdSerialNumber">
						<xsl:attribute name="ident:protocolSpecificName">not applicable</xsl:attribute>
				</xsl:element>
				<xsl:element name="IdValues">
					<xsl:apply-templates select="ffscan:DeviceClass"/>
					<xsl:apply-templates select="ffscan:VendorName"/>
					<xsl:apply-templates select="ffscan:ModelName"/>
					<xsl:apply-templates select="ffscan:Revision"/>
					<xsl:apply-templates select="ffscan:ManufacturerSpecificExtension"/>
				</xsl:element>
			</xsl:element>
	</xsl:template>

<!-- 
FF Block catalog identifcation
-->
	<xsl:template match="ffdevice:DeviceIdentification_FF_Block">
			<xsl:element name="DeviceIdentification">
				<xsl:attribute name="ident:idDTMSupportLevel">
					<xsl:value-of select="@ffident:idDTMSupportLevel"/>
				</xsl:attribute>
				<xsl:apply-templates select="ffdevice:IdBusProtocol"/>
				<xsl:element name="IdBusProtocolVersion" >
						<xsl:attribute name="ident:protocolSpecificName">not applicable</xsl:attribute>
				</xsl:element>
				<xsl:apply-templates select="ffdevice:IdManufacturer"/>
				<xsl:apply-templates select="ffdevice:IdTypeID"/>
				<xsl:apply-templates select="ffdevice:DDRevision"/>
				<xsl:element name="IdHardwareRevision">
						<xsl:attribute name="ident:protocolSpecificName">not applicable</xsl:attribute>
				</xsl:element>
				<xsl:element name="IdValues">
					<xsl:apply-templates select="ffdevice:BlockIndex"/>
					<xsl:apply-templates select="ffdevice:DDMemberID"/>
					<xsl:apply-templates select="ffdevice:DDItemId"/>
					<xsl:apply-templates select="ffdevice:IdProfile"/>
					<xsl:apply-templates select="ffdevice:IdProfileRevision"/>
					<xsl:apply-templates select="ffdevice:ManufacturerSpecificExtension"/>
				</xsl:element>
			</xsl:element>
	</xsl:template>
<!-- 
FF Block scan identifcation
-->
	<xsl:template match="ffscan:ScanIdentification_FF_Block">
			<xsl:element name="ScanIdentification">
				<xsl:apply-templates select="@configuredState" />
				<xsl:apply-templates select="fdt:CommunicationError"/>
				<xsl:apply-templates select="ffscan:IdBusProtocol"/>
				<xsl:element name="IdBusProtocolVersion" >
						<xsl:attribute name="ident:protocolSpecificName">not applicable</xsl:attribute>
				</xsl:element>
				<xsl:apply-templates select="ffscan:IdAddress"/>			
				<xsl:apply-templates select="ffscan:IdManufacturer"/>
				<xsl:apply-templates select="ffscan:IdTypeID"/>
				<xsl:apply-templates select="ffscan:DDRevision"/>
				<xsl:element name="IdHardwareRevision">
						<xsl:attribute name="ident:protocolSpecificName">not applicable</xsl:attribute>
				</xsl:element>
				<xsl:apply-templates select="ffscan:IdTag"/>
				<xsl:element name="IdSerialNumber">
						<xsl:attribute name="ident:protocolSpecificName">not applicable</xsl:attribute>
				</xsl:element>
				<xsl:element name="IdValues">
					<xsl:apply-templates select="ffscan:BlockIndex"/>
					<xsl:apply-templates select="ffscan:DDMemberID"/>
					<xsl:apply-templates select="ffscan:DDItemId"/>
					<xsl:apply-templates select="ffscan:IdProfile"/>
					<xsl:apply-templates select="ffscan:IdProfileRevision"/>
					<xsl:apply-templates select="ffscan:ManufacturerSpecificExtension"/>
				</xsl:element>
			</xsl:element>
	</xsl:template>

<!-- 
configured attribute
-->
	<xsl:template match="@configuredState">
		<xsl:attribute name="configuredState">
			<xsl:value-of select="."/>
		</xsl:attribute>
	</xsl:template>

<!-- 
device tag
-->
	<xsl:template match="ffscan:IdTag">
		<xsl:element name="IdDeviceTag">
			<xsl:attribute name="ident:protocolSpecificName">SM-IDENTIFY</xsl:attribute>
			<xsl:attribute name="ident:value"><xsl:value-of select="@ffident:pd-tag"/></xsl:attribute>
		</xsl:element>
	</xsl:template>
	

<!-- 
communicationError
-->
	<xsl:template match="fdt:CommunicationError">
		<xsl:element name="fdt:CommunicationError">
			<xsl:attribute name="communicationError"><xsl:value-of select="@communicationError"/></xsl:attribute>
			<xsl:attribute name="tag"><xsl:value-of select="@tag"/></xsl:attribute>
		</xsl:element>
	</xsl:template>
<!-- 
serialnumber
-->
	<xsl:template match="ffscan:IdSerialNumber">
		<xsl:element name="IdSerialNumber">
			<xsl:attribute name="ident:protocolSpecificName">DEV_ID</xsl:attribute>
			<xsl:attribute name="ident:value"><xsl:value-of select="@ffident:dev-id"/></xsl:attribute>
		</xsl:element>
	</xsl:template>
<!-- 
DataLinkAddress
-->
	<xsl:template match="ffscan:DataLinkAddress">
		<xsl:element name="IdAddress">
			<xsl:attribute name="ident:protocolSpecificName">Node address</xsl:attribute>
			<xsl:attribute name="ident:value"><xsl:value-of select="@ffident:dataLinkAddress"/></xsl:attribute>
		</xsl:element>
	</xsl:template>
	
<!-- 
busaddress
-->
	<xsl:template match="ffscan:IdAddress">
		<xsl:element name="IdAddress">
			<xsl:attribute name="ident:protocolSpecificName">Node address</xsl:attribute>
			<xsl:attribute name="ident:value"><xsl:value-of select="@ffident:deviceAddress"/></xsl:attribute>
		</xsl:element>
	</xsl:template>

	
<!-- 
DeviceClass, saved as protocol specific value
-->
	<xsl:template match="ffdevice:DeviceClass">
		<xsl:param name="value" select="@ffident:deviceClass"/>
		<xsl:element name="IdValue">
			<xsl:attribute name="ident:name">DeviceClass</xsl:attribute>
			<xsl:attribute name="ident:protocolSpecificName">Device Class</xsl:attribute>
			<xsl:call-template name="genMatch">
				<xsl:with-param name="value" select="$value"/>
			</xsl:call-template>
		</xsl:element>
	</xsl:template>
	<xsl:template match="ffscan:DeviceClass">
		<xsl:element name="IdValue">
			<xsl:attribute name="ident:name">DeviceClass</xsl:attribute>
			<xsl:attribute name="ident:protocolSpecificName">Device Class</xsl:attribute>
			<xsl:attribute name="ident:value">
				<xsl:value-of select="@ffident:deviceClass"/>
			</xsl:attribute>
		</xsl:element>
	</xsl:template>
	
<!-- 
VendorName, saved as protocol specific value
-->
	<xsl:template match="ffdevice:VendorName">
		<xsl:param name="value" select="@ffident:vendorName"/>
		<xsl:element name="IdValue">
			<xsl:attribute name="ident:name">VendorName</xsl:attribute>
			<xsl:attribute name="ident:protocolSpecificName">Vendor Name</xsl:attribute>
			<xsl:call-template name="genMatch">
				<xsl:with-param name="value" select="$value"/>
			</xsl:call-template>
		</xsl:element>
	</xsl:template>
	<xsl:template match="ffscan:VendorName">
		<xsl:element name="IdValue">
			<xsl:attribute name="ident:name">VendorName</xsl:attribute>
			<xsl:attribute name="ident:protocolSpecificName">Vendor Name</xsl:attribute>
			<xsl:attribute name="ident:value">
				<xsl:value-of select="@ffident:vendorName"/>
			</xsl:attribute>
		</xsl:element>
	</xsl:template>
<!-- 
ManufacturerSpecificExtension, saved as protocol specific value
-->
	<xsl:template match="ffdevice:ManufacturerSpecificExtension">
		<xsl:param name="value" select="@ffident:manufacturerSpecificExtension"/>
		<xsl:element name="IdValue">
			<xsl:attribute name="ident:name">ManufacturerSpecificExtension</xsl:attribute>
			<xsl:attribute name="ident:protocolSpecificName">???</xsl:attribute>
			<xsl:call-template name="genMatch">
				<xsl:with-param name="value" select="$value"/>
			</xsl:call-template>
		</xsl:element>
	</xsl:template>
	<xsl:template match="ffscan:ManufacturerSpecificExtension">
		<xsl:element name="IdValue">
			<xsl:attribute name="ident:name">ManufacturerSpecificExtension</xsl:attribute>
			<xsl:attribute name="ident:protocolSpecificName">???</xsl:attribute>
			<xsl:attribute name="ident:value">
				<xsl:value-of select="@ffident:manufacturerSpecificExtension"/>
			</xsl:attribute>
		</xsl:element>
	</xsl:template>	
	
<!-- 
ModelName, saved as protocol specific value
-->
	<xsl:template match="ffdevice:ModelName">
		<xsl:param name="value" select="@ffident:modelName"/>
		<xsl:element name="IdValue">
			<xsl:attribute name="ident:name">Model Name</xsl:attribute>
			<xsl:attribute name="ident:protocolSpecificName">Vendor Name</xsl:attribute>
			<xsl:call-template name="genMatch">
				<xsl:with-param name="value" select="$value"/>
			</xsl:call-template>
		</xsl:element>
	</xsl:template>
	<xsl:template match="ffscan:ModelName">
		<xsl:element name="IdValue">
			<xsl:attribute name="ident:name">ModelName</xsl:attribute>
			<xsl:attribute name="ident:protocolSpecificName">Model Name</xsl:attribute>
			<xsl:attribute name="ident:value">
				<xsl:value-of select="@ffident:modelName"/>
			</xsl:attribute>
		</xsl:element>
	</xsl:template>
	
<!-- 
DevId:IdBusProtocol
-->
	<xsl:template match="ffdevice:IdBusProtocol">
		<xsl:param name="manid" select="@ffident:busProtocol"/>
		<xsl:element name="IdBusProtocol">
			<xsl:attribute name="ident:protocolSpecificName">FF Bus Protocol</xsl:attribute>
			<xsl:call-template name="genMatch">
				<xsl:with-param name="value" select="$manid"/>
			</xsl:call-template>
		</xsl:element>
	</xsl:template>
	<xsl:template match="ffscan:IdBusProtocol">
		<xsl:element name="IdBusProtocol">
			<xsl:attribute name="ident:protocolSpecificName">FF Bus Protocol</xsl:attribute>
			<xsl:attribute name="ident:value">
				<xsl:value-of select="@ffident:busProtocol"/>
			</xsl:attribute>
		</xsl:element>
	</xsl:template>
	
<!-- 
Revision, saved as protocol specific value
-->
	<xsl:template match="ffdevice:Revision">
		<xsl:param name="value" select="@ffident:revision"/>
		<xsl:element name="IdValue">
			<xsl:attribute name="ident:name">Revision</xsl:attribute>
			<xsl:attribute name="ident:protocolSpecificName">Revision</xsl:attribute>
			<xsl:call-template name="genMatch">
				<xsl:with-param name="value" select="$value"/>
			</xsl:call-template>
		</xsl:element>
	</xsl:template>
	<xsl:template match="ffscan:Revision">
		<xsl:element name="IdValue">
			<xsl:attribute name="ident:name">Revision</xsl:attribute>
			<xsl:attribute name="ident:protocolSpecificName">Revision</xsl:attribute>
			<xsl:attribute name="ident:value">
				<xsl:value-of select="@ffident:revision"/>
			</xsl:attribute>
		</xsl:element>
	</xsl:template>
	
<!-- 
BlockIndex, saved as protocol specific value
-->
	<xsl:template match="ffdevice:BlockIndex">
		<xsl:param name="value" select="@ffident:blockIndex"/>
		<xsl:element name="IdValue">
			<xsl:attribute name="ident:name">BlockIndex</xsl:attribute>
			<xsl:attribute name="ident:protocolSpecificName">Block Index</xsl:attribute>
			<xsl:call-template name="genMatch">
				<xsl:with-param name="value" select="$value"/>
			</xsl:call-template>
		</xsl:element>
	</xsl:template>
	<xsl:template match="ffscan:BlockIndex">
		<xsl:element name="IdValue">
			<xsl:attribute name="ident:name">BlockIndex</xsl:attribute>
			<xsl:attribute name="ident:protocolSpecificName">Block Index</xsl:attribute>
			<xsl:attribute name="ident:value">
				<xsl:value-of select="@ffident:blockIndex"/>
			</xsl:attribute>
		</xsl:element>
	</xsl:template>
	
<!-- 
DDMemberID, saved as protocol specific value
-->
	<xsl:template match="ffdevice:DDMemberID">
		<xsl:param name="value" select="@ffident:ddMemberID"/>
		<xsl:element name="IdValue">
			<xsl:attribute name="ident:name">DDMemberID</xsl:attribute>
			<xsl:attribute name="ident:protocolSpecificName">DD Member ID</xsl:attribute>
			<xsl:call-template name="genMatch">
				<xsl:with-param name="value" select="$value"/>
			</xsl:call-template>
		</xsl:element>
	</xsl:template>
	<xsl:template match="ffscan:DDMemberID">
		<xsl:element name="IdValue">
			<xsl:attribute name="ident:name">DDMemberID</xsl:attribute>
			<xsl:attribute name="ident:protocolSpecificName">DD Member ID</xsl:attribute>
			<xsl:attribute name="ident:value">
				<xsl:value-of select="@ffident:ddMemberID"/>
			</xsl:attribute>
		</xsl:element>
	</xsl:template>
	
<!-- 
DDItemId, saved as protocol specific value
-->
	<xsl:template match="ffdevice:DDItemId">
		<xsl:param name="value" select="@ffident:ddItemId"/>
		<xsl:element name="IdValue">
			<xsl:attribute name="ident:name">DDItemId</xsl:attribute>
			<xsl:attribute name="ident:protocolSpecificName">DD Item ID</xsl:attribute>
			<xsl:call-template name="genMatch">
				<xsl:with-param name="value" select="$value"/>
			</xsl:call-template>
		</xsl:element>
	</xsl:template>
	<xsl:template match="ffscan:DDItemId">
		<xsl:element name="IdValue">
			<xsl:attribute name="ident:name">DDItemId</xsl:attribute>
			<xsl:attribute name="ident:protocolSpecificName">DD Item ID</xsl:attribute>
			<xsl:attribute name="ident:value">
				<xsl:value-of select="@ffident:ddItemId"/>
			</xsl:attribute>
		</xsl:element>
	</xsl:template>
	
<!-- 
IdProfile, saved as protocol specific value
-->
	<xsl:template match="ffdevice:IdProfile">
		<xsl:param name="value" select="@ffident:profile"/>
		<xsl:element name="IdValue">
			<xsl:attribute name="ident:name">IdProfile</xsl:attribute>
			<xsl:attribute name="ident:protocolSpecificName">???</xsl:attribute>
			<xsl:call-template name="genMatch">
				<xsl:with-param name="value" select="$value"/>
			</xsl:call-template>
		</xsl:element>
	</xsl:template>
	<xsl:template match="ffscan:IdProfile">
		<xsl:element name="IdValue">
			<xsl:attribute name="ident:name">IdProfile</xsl:attribute>
			<xsl:attribute name="ident:protocolSpecificName">???</xsl:attribute>
			<xsl:attribute name="ident:value">
				<xsl:value-of select="@ffident:profile"/>
			</xsl:attribute>
		</xsl:element>
	</xsl:template>
	
<!-- 
IdProfileRevision, saved as protocol specific value
-->
	<xsl:template match="ffdevice:IdProfileRevision">
		<xsl:param name="value" select="@ffident:profileRevision"/>
		<xsl:element name="IdValue">
			<xsl:attribute name="ident:name">IdProfileRevision</xsl:attribute>
			<xsl:attribute name="ident:protocolSpecificName">???</xsl:attribute>
			<xsl:call-template name="genMatch">
				<xsl:with-param name="value" select="$value"/>
			</xsl:call-template>
		</xsl:element>
	</xsl:template>
	<xsl:template match="ffscan:IdProfileRevision">
		<xsl:element name="IdValue">
			<xsl:attribute name="ident:name">IdProfileRevision</xsl:attribute>
			<xsl:attribute name="ident:protocolSpecificName">???</xsl:attribute>
			<xsl:attribute name="ident:value">
				<xsl:value-of select="@ffident:profileRevision"/>
			</xsl:attribute>
		</xsl:element>
	</xsl:template>
	
<!-- 
DeviceDDRevision, saved as protocol specific value
-->
	<xsl:template match="ffdevice:DeviceDDRevision">
		<xsl:param name="value" select="@ffident:deviceDDRevision"/>
		<xsl:element name="IdValue">
			<xsl:attribute name="ident:name">DeviceDDRevision</xsl:attribute>
			<xsl:attribute name="ident:protocolSpecificName">???</xsl:attribute>
			<xsl:call-template name="genMatch">
				<xsl:with-param name="value" select="$value"/>
			</xsl:call-template>
		</xsl:element>
	</xsl:template>
	<xsl:template match="ffscan:DeviceDDRevision">
		<xsl:element name="IdValue">
			<xsl:attribute name="ident:name">DeviceDDRevision</xsl:attribute>
			<xsl:attribute name="ident:protocolSpecificName">???</xsl:attribute>
			<xsl:attribute name="ident:value">
				<xsl:value-of select="@ffident:deviceDDRevision"/>
			</xsl:attribute>
		</xsl:element>
	</xsl:template>
	
	
<!-- 
Manufacturer
-->
	<xsl:template match="ffdevice:IdManufacturer">
		<xsl:param name="manid" select="@ffident:manufacturerID"/>
		<xsl:element name="IdManufacturer">
			<xsl:attribute name="ident:protocolSpecificName">MANUFAC_ID</xsl:attribute>
			<xsl:call-template name="genMatch">
				<xsl:with-param name="value" select="$manid"/>
			</xsl:call-template>
		</xsl:element>
	</xsl:template>
	<xsl:template match="ffscan:IdManufacturer">
		<xsl:element name="IdManufacturer">
			<xsl:attribute name="ident:protocolSpecificName">MANUFAC_ID</xsl:attribute>
			<xsl:attribute name="ident:value">
				<xsl:value-of select="@ffident:manufacturerID"/>
			</xsl:attribute>
		</xsl:element>
	</xsl:template>
	
<!-- 
Manufacturer
-->
	<xsl:template match="ffdevice:Device_man_id">
		<xsl:param name="manid" select="@ffident:device_man_id"/>
		<xsl:element name="IdManufacturer">
			<xsl:attribute name="ident:protocolSpecificName">MANUFAC_ID</xsl:attribute>
			<xsl:call-template name="genMatch">
				<xsl:with-param name="value" select="$manid"/>
			</xsl:call-template>
		</xsl:element>
	</xsl:template>
	<xsl:template match="ffscan:Device_man_id">
		<xsl:element name="IdManufacturer">
			<xsl:attribute name="ident:protocolSpecificName">MANUFAC_ID</xsl:attribute>
			<xsl:attribute name="ident:value">
				<xsl:value-of select="@ffident:device_man_id"/>
			</xsl:attribute>
		</xsl:element>
	</xsl:template>
	
	
<!-- 
device type
-->
	<xsl:template match="ffdevice:IdTypeID">
		<xsl:param name="value" select="@ffident:dev_type"/>
		<xsl:element name="IdTypeID">
			<xsl:attribute name="ident:protocolSpecificName">DEV_TYPE</xsl:attribute>
			<xsl:call-template name="genMatch">
				<xsl:with-param name="value" select="$value"/>
			</xsl:call-template>
		</xsl:element>
	</xsl:template>
	<xsl:template match="ffscan:IdTypeID">
		<xsl:element name="IdTypeID">
			<xsl:attribute name="ident:protocolSpecificName">DEV_TYPE</xsl:attribute>
			<xsl:attribute name="ident:value">
				<xsl:value-of select="@ffident:dev_type"/>
			</xsl:attribute>
		</xsl:element>
	</xsl:template>



<!-- 
software revision
-->
	<xsl:template match="ffdevice:IdSoftwareRevision">
		<xsl:param name="value" select="@ffident:device_dd_Revision"/>
		<xsl:element name="IdSoftwareRevision">
			<xsl:attribute name="ident:protocolSpecificName">DD_REV and DD_REV</xsl:attribute>
			<xsl:call-template name="genMatch">
				<xsl:with-param name="value" select="$value"/>
			</xsl:call-template>
		</xsl:element>
	</xsl:template>
		<xsl:template match="ffscan:IdSoftwareRevision">
		<xsl:param name="value" select="@ffident:device_dd_Revision"/>
		<xsl:element name="IdSoftwareRevision">
			<xsl:attribute name="ident:protocolSpecificName">DD_REV and DD_REV</xsl:attribute>
			<xsl:call-template name="genMatch">
				<xsl:with-param name="value" select="$value"/>
			</xsl:call-template>
		</xsl:element>
	</xsl:template>
	

<!-- 
hardware revision
-->
	<xsl:template match="ffdevice:IdHardwareRevision">
		<xsl:param name="value" select="@ffident:device_dd_Revision"/>
		<xsl:element name="IdHardwareRevision">
			<xsl:attribute name="ident:protocolSpecificName">DD_REV and DD_REV</xsl:attribute>
			<xsl:call-template name="genMatch">
				<xsl:with-param name="value" select="$value"/>
			</xsl:call-template>
		</xsl:element>
	</xsl:template>
		<xsl:template match="ffscan:IdHardwareRevision">
		<xsl:param name="value" select="@ffident:device_dd_Revision"/>
		<xsl:element name="IdHardwareRevision">
			<xsl:attribute name="ident:protocolSpecificName">DD_REV and DD_REV</xsl:attribute>
			<xsl:call-template name="genMatch">
				<xsl:with-param name="value" select="$value"/>
			</xsl:call-template>
		</xsl:element>
	</xsl:template>
	
<!-- 
DDRevision
-->
	<xsl:template match="ffdevice:DDRevision">
		<xsl:param name="value" select="@ffident:ddRevision"/>
		<xsl:element name="IdSoftwareRevision">
			<xsl:attribute name="ident:protocolSpecificName">DD_REV and DD_REV</xsl:attribute>
			<xsl:call-template name="genMatch">
				<xsl:with-param name="value" select="$value"/>
			</xsl:call-template>
		</xsl:element>
	</xsl:template>
		<xsl:template match="ffscan:DDRevision">
		<xsl:param name="value" select="@ffident:ddRevision"/>
		<xsl:element name="IdSoftwareRevision">
			<xsl:attribute name="ident:protocolSpecificName">DD_REV and DD_REV</xsl:attribute>
			<xsl:call-template name="genMatch">
				<xsl:with-param name="value" select="$value"/>
			</xsl:call-template>
		</xsl:element>
	</xsl:template>
	
<!-- 
DeviceRevision
-->
	<xsl:template match="ffdevice:DeviceRevision">
		<xsl:param name="value" select="@ffident:deviceRevision"/>
		<xsl:element name="IdHardwareRevision">
			<xsl:attribute name="ident:protocolSpecificName">DD_REV and DD_REV</xsl:attribute>
			<xsl:call-template name="genMatch">
				<xsl:with-param name="value" select="$value"/>
			</xsl:call-template>
		</xsl:element>
	</xsl:template>
		<xsl:template match="ffscan:DeviceRevision">
		<xsl:param name="value" select="@ffident:deviceRevision"/>
		<xsl:element name="IdHardwareRevision">
			<xsl:attribute name="ident:protocolSpecificName">DD_REV and DD_REV</xsl:attribute>
			<xsl:call-template name="genMatch">
				<xsl:with-param name="value" select="$value"/>
			</xsl:call-template>
		</xsl:element>
	</xsl:template>


<!-- 
generate matching information
-->
	<xsl:template name="genMatch">
		<xsl:param name="value"/>
		<xsl:param name="empty"/>
		<xsl:if test="$value!=$empty">
			<xsl:attribute name="ident:value"><xsl:value-of select="$value"/></xsl:attribute>
		</xsl:if>
		<xsl:apply-templates select="ffident:RegExpr"/>
	</xsl:template>
	
<!-- 
generate regular exressions
-->
	<xsl:template match="ffident:RegExpr">
		<!-- copy pattern info -->
		<xsl:call-template name="genPattern">
			<xsl:with-param name="match" select="@match"/>
			<xsl:with-param name="nomatch" select="@nomatch"/>
		</xsl:call-template>
	</xsl:template>
	
<!-- 
generate pattern information
-->
	<xsl:template name="genPattern">
		<xsl:param name="match"/>
		<xsl:param name="nomatch"/>
		<xsl:param name="empty"/>
		<xsl:choose>
		<xsl:when test="$match!=$empty">
			<xsl:element name="ident:RegExpr">
				<xsl:attribute name="match"><xsl:value-of select="$match"/></xsl:attribute>
				<xsl:if test="$nomatch!=$empty">
					<xsl:attribute name="nomatch"><xsl:value-of select="$nomatch"/></xsl:attribute>
				</xsl:if>
			</xsl:element>
		</xsl:when>
		<xsl:when test="$nomatch!=$empty">
			<xsl:element name="ident:RegExpr">
				<xsl:attribute name="nomatch"><xsl:value-of select="$nomatch"/></xsl:attribute>
				<xsl:if test="$match!=$empty">
					<xsl:attribute name="match"><xsl:value-of select="$match"/></xsl:attribute>
				</xsl:if>
			</xsl:element>
		</xsl:when>
		</xsl:choose>
	</xsl:template>
</xsl:transform>